<?php
namespace app\platform\controller;


class Fun
{
    //检测跨域
    public static function origin(){
        $origin = isset($_SERVER['HTTP_ORIGIN'])? $_SERVER['HTTP_ORIGIN'] : '';
        $allow_origin = array(
            'http://newmerchant.speeda.cn',
            'http://newbusiness.speeda.cn',
            'http://114.55.60.173',
            'http://a.roy.com'
        );
        if(in_array($origin, $allow_origin)){
            header('Access-Control-Allow-Origin:'.$origin);
        }else{
            die('Invalid Access');
        }
    }
}